using System.Threading.Tasks;
using JlPay.Sdk.Core;
using JlPay.Sdk.Models.Trans.Common;

namespace JlPay.Sdk.Services.Trans.Common
{
    /// <summary>
    /// 获取OpenID服务
    /// </summary>
    public class GetOpenidService : BaseService
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="config">配置对象</param>
        public GetOpenidService(Config config) : base(config)
        {
        }

        /// <summary>
        /// 获取OpenID接口
        /// </summary>
        /// <param name="request">获取OpenID请求</param>
        /// <returns>获取OpenID响应结果</returns>
        public async Task<GetOpenidResponse> GetOpenidAsync(GetOpenidRequest request)
        {
            return await PostAsync<GetOpenidRequest, GetOpenidResponse>(request, GetOpenidRequest.API_URL);
        }
    }
} 